from __future__ import annotations

from dataclasses import dataclass


@dataclass
class SheaveCount:
    count: int
    spacing_m: float
    note: str


def estimate_sheave_count(vertical_span_m: float, unit_load_kN: float, sheave_capacity_kN: float = 50.0, min_spacing_m: float = 3.0) -> SheaveCount:
    """根据垂直档距与荷载估算滑车数量与挂点间距（经验）。"""

    n = max(1, int(unit_load_kN / max(1e-6, sheave_capacity_kN)) + 1)
    spacing = max(min_spacing_m, vertical_span_m / max(1, n))
    return SheaveCount(count=n, spacing_m=spacing, note="按承载力与竖向跨距估算")


